<?php 
$sql = "SELECT
			  d.title,
			  d.meta_description,
			  d.description,
			  d.meta_key
		  FROM
			  pages AS c,
			  page_description AS d
		  WHERE
			c.page_id = d.page_id
			AND
			d.lang_id = '".$_SESSION['lang_id']."'
			AND
			c.sef_url = 'home' 
			
		  ";
$result = query($sql);
$row = mysql_fetch_object($result);


head(sth($row->title),sth($row->meta_description),sth($row->meta_key));


?>
<script type="text/javascript" src="<?=HTML_BASE?>js/jquery.carouFredSel-6.2.1-packed.js"></script>
<script type="text/javascript" src="<?=HTML_BASE?>js/jquery.touchSwipe.min.js"></script>

		<div id="content">
			
			<div class="left narrow">
				
				<div id="homelogin">
					<h2><?=__SMART_PARKING?></h2>
					<span><?=__SMART_PARKING_DESCRIPTION?></span>
					<a style="float:left" class="button" href="<?=HTML_BASE.$_SESSION['lang']?>/login/sign-up"><?=__sign_up_now?>!</a>
					<form id="login-data" action="https://portal.olapark.pt/login_from_web.aspx" method="post" enctype="multipart/form-data">
                    
                    <input type="hidden" name="uName" value=""/>
                    <input type="hidden" name="uPass" value=""/>
                    <input type="hidden" name="uPersistent" value=""/>
                    
                    </form>
					
                    <form id="login-form">
					<table width="100%">
						<tr>
							<td><?=__Username?></td>
							<td width="40%" align="right"><input id="login-user" name="username" type="text" value=""></td>
						</tr>
						<tr>
							<td><?=__Password?></td>
							<td align="right"><input  id="login-pass" name="password" type="password" value=""></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td align="left" style="text-transform:lowercase;">
								<label>
								<input name="remember" type="checkbox" value="1">
								<?=__Remember_me?>
								</label>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<br>
								<a href="#"  onclick="login(); return false;"  class="button"><?=__Login?></a>
                                <a class="lost" href="#"><?=__lost_password?></a>
							</td>
							</tr>
					</table>
					</form>
                    <script type="text/javascript">
  
						
						
						function login()
							{
								
								$('#homelogin input,select').removeClass('redborder');
								var error = '';
							
								if(!$('#login-user').val())
								{ 
									$('#login-user').addClass('redborder');
									error = 1;
								}	
								
								if(!$('#login-pass').val())
								{ 
									$('#login-pass').addClass('redborder');
									error = 1;
								}					
								
								if(!error)
								{
									var remember = 0;
									if($('#login-remember :checked')) remember = 1;
									
									$('[name="uName"]').val(base64.encode($('#login-user').val()));
									$('[name="uPass"]').val(base64.encode($('#login-pass').val()));
									$('[name="uPersistent"]').val(remember);
									
									$('#login-data').submit();
									
								
								}
											 
							}
							$('#login-form input').on('keyup', function(e) {
								
								if (e.which == 13) {
									login();
								}
							});
							$(document).ready(function() {
								// Homepage slider
								$('#homeslider').carouFredSel({
									responsive: true,
									width: '100%',
									height: 450,
									auto: {
											pauseOnHover: 'resume',
											timeoutDuration: 4000
										}
								});
							});
							
					</script>

				</div>
				
			</div>
			
			<div class="right wide">
            		
            		<div id="homeslider">
					<?php require '../languages/'.$_SESSION["lang"].'.slider.php'; ?>
					</div>
				
			</div>
			
			<div class="left full">
				<?=stripslashes($row->description)?>
			</div>
			
		</div>
		
	
<?php

foot('home');
?>